package com.stagewebserver.webserver.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.stagecommon.common.pojo.OrderComment;
import com.stagecommon.common.pojo.RespBean;
import com.stagecommon.common.vo.OrderCommentVo;
import com.stagewebserver.webserver.service.OrderCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 订单评论控制
 * @author: yxl
 * @since: 2022-01-14
 **/
@RestController
@RequestMapping("/orderComment")
public class OrderCommentController {

    @Autowired
    private OrderCommentService orderCommentService;

    /**
     * 评论订单
     * @param orderComment
     * @return
     */
    @PostMapping("/addOrderComment")
    public RespBean addOrderComment(@RequestBody OrderComment orderComment){
        return RespBean.operationSuccess("评论成功", 200, orderCommentService.addComment(orderComment));
    }

    /**
     * 回复评论
     * @param orderComment
     * @return
     */
    @PostMapping("/replyComment")
    public RespBean replyComment(@RequestBody OrderComment orderComment){
        return RespBean.operationSuccess("回复成功！",200,orderCommentService.updateReplyComment(orderComment));
    }

}
